﻿<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<html>
	<head>
		<link href="<%=request.getContextPath() %>/css/common.css" rel="stylesheet" type="text/css" />
		<script type="text/javascript" src="<%=request.getContextPath() %>/ckeditor/ckeditor.js"> </script>
	</head>
<body>
<div class="main-content-right">
        <div class="main-text-box">
      		<div class="main-text-box-tbg">
                <div class="main-text-box-bbg">
                    <div class="article-box">
                    	<!--新闻的标题-->

                        <h1>${news.title}</h1>
                        <div class="source-bar">发布者: 分类：新闻信息: 更新时间：</div>
                        <div class="article-content">
                            <span class="article-summary"><b>摘要：</b></span>
                         </div>
                        <div>
                            <img src="<%=request.getContextPath()%>/upload/${news.picPath}" alt="">
                            内容：
                        </div>
                    </div>
                </div>
            </div>
        </div>
        
    </div>
</body>
    <script type="text/javascript" src="../js/jquery-1.9.1.js"></script>
    <script type="text/javascript">
        $(function () {
            var id='${param.id}';
            $.ajax({
                "url":"/newsServlet",
                "type":"post",
                "data":{"action":"getDetailById","id":id},
                "dataType":"json",
                "success":callback,
                "error":function () {
                    alert("请求异常，请与管理员联系!");
                }
            })
            function callback(data) {
                $("#title").val(data.title);
                if(data.categoryId==1){
                    $("[value='1']").prop("selected",true);
                }else if(data.categoryId==2){
                    $("[value='2']").prop("selected",true);
                }else if(data.categoryId==3){
                    $("[value='3']").prop("selected",true);
                }else if(data.categoryId==4){
                    $("[value='4']").prop("selected",true);
                }else if(data.categoryId==5){
                    $("[value='5']").prop("selected",true);
                } else if(data.categoryId==6){
                    $("[value='6']").prop("selected",true);
                }
            }
        })
    </script>
</html>